package com.dongdong.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdong.mapper.TbSellerMapper;
import com.dongdong.pojo.TbSeller;
import com.dongdong.service.SellerService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
@org.springframework.stereotype.Service
public class SellerServiceImpl implements SellerService {

    @Autowired
    private TbSellerMapper tbSellerMapper;

    @Override
    public List<TbSeller> select(String name ,String nickName,String stu) {
        List<TbSeller> tbSellers = tbSellerMapper.selectName(name,nickName,stu);
//        List<TbSeller> tbSellers = tbSellerMapper.selectByExample(null);
        return tbSellers;
    }

    @Override
    public TbSeller selectId(String id) {
        TbSeller tbSeller = tbSellerMapper.selectByPrimaryKey(id);
        return tbSeller;
    }

    @Override
    public boolean update(TbSeller tbSeller) {
        int i = tbSellerMapper.updateByPrimaryKeySelective(tbSeller);
        return i > 0;
    }
}
